package implementation;

import model.HasSource;
import model.Operation;
import operand.MyValue;
import operand.Operand;

/**
 * The {@link IntegerAddition} is the addition {@link Operation} on the data type {@link Integer}.
 *
 */
public class IntegerAddition extends Operation<Integer>{

	/**
	 * Constructor of {@link IntegerAddition}.
	 * @param summand1 is the first summand.
	 * @param summand2 is the second summand.
	 */
	public IntegerAddition(final HasSource<Operand<Integer>> summand1,
			final HasSource<Operand<Integer>> summand2) {
		super(summand1, summand2);
	}

	@Override
	protected Operand<Integer> calculateTransitive(final MyValue<Integer> firstValue,
			final MyValue<Integer> secondValue) {
		return new MyValue<Integer>(firstValue.getValue() + secondValue.getValue());
	}
}
